import { defineComponent } from "vue";
import styles from "./Toolbar.module.less";
import { useStore as useUserStore } from "@/store/user";

export default defineComponent({
  props: {
    config: {
      type: Array,
    }
  },
  setup(props, { expose }) {
    const userStore = useUserStore();

    return () => (
      (props.config && props.config.length > 0) && <div class={styles.toolbar}>
        {
          props.config.filter((item: any) => !item.hidden?.()).map((item: any) => {
            return item?.el?.()
          })
        }
      </div>
    )
  }
})